<template>
	<view class="content">
		<navbar title='消费记录'>
		</navbar>
		<view class="content">
			<view class="menlist">
				<view class="nodata" v-if="list==''">
					<image class="kzt_img_zwsj" src="@/pages_client/static/mine/kzt_img_zwsj.png" mode="" />
					<text>暂无相关订单</text>
				</view>
				<view class="oitem" v-for="(item,index) in list" :key="index" @click.stop="getdetail(item)">
					<view class="ohead">
						<text class="dianname txt">订单ID:{{item.order_sn}}</text>
					</view>
					<view class="olist" v-if="item.goods_list">
						<view class="onav" v-for="(i,ind) in item.goods_list" :key="ind">
							<image class="tu" :src="i.goods_image" />
							<view class="navright">
								<view class="navone">
									<text class="bt txt">{{i.goods_name}}</text>
									
								</view>
								<view class="navone mt">
									<text class="jia">￥{{i.price}}</text>
								</view>
								
							</view>
						</view>
					</view>
					<view class="heview">
						<view class="hename">
							<text class="fuitem">付款时间:{{ item.paytime }}</text>
							<text class="fuitem">核销时间:{{ item.hexiaotime }}</text>
						</view>
					</view>
				</view>

			</view>
		</view>

		<!-- <view class="botview">
			<view class="tjia">确认</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		components: {
		},
		data() {
			return {
				list: [{
					name: '全部'
				}, {
					name: '待付款'
				}, {
					name: '待发货'
				},{
					name: '待收货'
				}, {
					name: '已完成'
				}],
				current: 0,
				value:1,
				shop_id:'',
				list: [],
				page: 1,
				limit: 10,
				last_page: 1,
				status: "loadmore",
				user_id:''
			}
		},
		onLoad(option) {
			if(option.shop_id){
				this.shop_id = option.shop_id
			}
			if(option.user_id){
				this.user_id = option.user_id
			}
			this.getList()
		},
		onShow() {
		},
		methods: {
			closeteam(){
				this.teampopshow = false
			},
			change(index) {
				this.current = index;
			},
			getdetail(item){
				// this.navrouter('/pages_client/mine/OrderDetail?id='+item.id)
			},
			async getList(){//列表数据
				let res = await this.$u.api.MyUsersOrder({
				  limit:this.limit,
				  page:this.page,
				  shop_id:this.shop_id,
				  user_id:this.user_id
				});
				this.last_page = res.lastpage
				let list = res.list;
				this.list = this.page == 1 ? list : [...this.list, ...list];	
				if(res.list==''||Number(list.length)<Number(this.limit)||Number(this.page)>Number(this.last_page)){
					this.status = 'nomore';
				}
				
			},
			loadmore() {
				let page = this.page;
				// let last_page = this.last_page;
				if (this.status == 'loadmore') {
					this.page++;
					this.getList();
				}
			},
			getClear(){
				this.list = []
				this.page = 1,
				this.status= "loadmore"
				this.getList()
			},
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #f9f9f9;
	}
	.content{
		background-color: #f9f9f9;
		padding-bottom: 30rpx;
		.tuanone{
			background-color: #fff;
			padding: 15rpx 10rpx;
			display: flex;
			flex-direction: row;
			align-items: center;
			width: 100%;
			.tuhead{
				max-width: 80%;
				white-space: nowrap;
				.tuitem{
					padding: 8rpx 20rpx;
					background: #F5F5F5;
					border-radius: 10rpx;
					margin-right: 20rpx;
					font-weight: 500;
					font-size: 26rpx;
					color: #333333;
					display: inline-block;
				}
				.tactive{
					background: #52443B;
					color: #fff;
				}
			}
			.icon_tx{
				margin-left: auto;
				width: 40rpx;
				height: 40rpx;
			}
		}	
	}
	.nlist{
		padding: 20rpx;
		display: flex;
		flex-direction: column;
		.nitem{
			padding: 20rpx 25rpx;
			background: #FFFFFF;
			border-radius: 30rpx;
			.nione{
				display: flex;
				flex-direction: row;
				align-items: center;
				.tous{
					width: 81rpx;
					border-radius: 50%;
					height: 81rpx;
					margin-right: 15rpx;
				}
				.niright{
					width: 82%;
					display: flex;
					flex-direction: column;
					.rione{
						display: flex;
						flex-direction: row;
						align-items: center;
						.riname{
							max-width: 80%;
							display: inline-block;
							font-weight: bold;
							font-size: 32rpx;
							color: #333333;
						}
						.hyuan{
							width: 80rpx;
							height: 32rpx;
							background: linear-gradient(-90deg, #272727, #4D4D4D);
							border-radius: 6rpx;
							display: flex;
							align-items: center;
							justify-content: center;
							font-weight: 500;
							font-size: 22rpx;
							color: #FFFFFF;
							margin-left: 10rpx;
						}
						.idname{
							font-weight: 400;
							font-size: 24rpx;
							color: #999999;
						}
						.hui{
							margin-left: 40rpx;
						}

					}
					.mttwo{
						margin-top: 15rpx;
					}
				}
				.comm_icon_next{
					margin-left: auto;
					width: 24rpx;
					height: 24rpx;
				}
			}
			.zheview{
				border-top: 1rpx solid #eee;
				display: flex;
				flex-direction: column;
				margin-top: 20rpx;
				padding-top: 20rpx;
				.zheitem{
					display: flex;
					flex-direction: row;
					flex-wrap: wrap;
					.items{
						width: 50%;
						display: flex;
						flex-direction: row;
						align-items: center;
						margin-bottom: 10rpx;
						.ileft{
							font-weight: 500;
							font-size: 24rpx;
							color: #999999;
						}
						.ival{
							font-weight: 500;
							font-size: 26rpx;
							color: #333333;
						}
					}
				}
				.shengbtn{
					display: flex;
					flex-direction: row;
					justify-content: flex-end;
					padding: 0 20rpx 20rpx 0;
					.sbtn{
						padding: 15rpx 25rpx;
						background: #52443B;
						border-radius: 16rpx 16rpx 16rpx 16rpx;
						font-weight: bold;
						font-size: 28rpx;
						color: #FFFFFF;
						margin-left: 20rpx;
					}
				}
			}
		}
	}
	.botview{
		position: fixed;
		height: 120rpx;
		width: 100%;
		bottom: 0;
		background-color: #fff;
		z-index: 10;
		padding: 0 30rpx;
		display: flex;
		align-items: center;
		.tjia{
			width: 100%;
			height: 90rpx;
			background: #52443B;
			border-radius: 16rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			font-weight: bold;
			font-size: 28rpx;
			color: #FFFFFF;
		}
	}
	.menlist{
		padding:30rpx 22rpx;
	}
	.oitem{
		display: flex;
		flex-direction: column;
		background: #FFFFFF;
		border-radius: 20rpx;
		margin-bottom: 24rpx;
		padding: 20rpx;
		.ohead{
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-bottom: 30rpx;
			.icon_sj{
				width: 30rpx;
				height: 30rpx;
				margin-right: 9rpx;
			}
			.dianname{
				max-width: 70%;
				display: inline-block;
				font-weight: bold;
				font-size: 28rpx;
				color: #272727;
			}
			.zt{
				font-weight: 500;
				font-size: 25rpx;
				color: #FF0050;
			}
		}
		.olist{
			display: flex;
			flex-direction: column;
			.onav{
				display: flex;
				flex-direction: row;
				margin-bottom: 20rpx;
				.tu{
					width: 150rpx;
					height: 150rpx;
					border-radius: 10rpx;
					margin-right: 20rpx;
				}
				.navright{
					width: 73%;
					display: flex;
					flex-direction: column;
					.navone{
						display: flex;
						flex-direction: row;
						margin-bottom: 10rpx;
						.bt{
							max-width: 100%;
							display: inline-block;
							font-weight: 500;
							font-size: 26rpx;
							color: #222222;
						}
						.btmiao{
							max-width: 80%;
							display: inline-block;
							font-weight: 500;
							font-size: 20rpx;
							color: #BBBBBB;
						}
						.jia{
							font-weight: bold;
							font-size: 26rpx;
							color: #1A1A1A;
						}
						.zheng{
							padding: 4rpx 20rpx;
							border-radius: 6rpx;
							border: 1px solid #999999;
							font-weight: 500;
							font-size: 20rpx;
							color: #999999;
						}
					}
					.mt{
						margin-top: auto;
					}
				}
			}
			.onav:last-child{
				margin-bottom: 0;
			}
			
		}
		.heview{
			display: flex;
			flex-direction: column;
			.hename{
				padding: 15rpx 0rpx 0;
				display: flex;
				flex-direction: row;
				.fuitem{
					font-weight: 400;
					font-size: 20rpx;
					color: #808080;
					flex: 1;
					display: flex;
					flex-direction: row;
					align-items: center;
				}
			}
			.btn{
				padding: 10rpx 20rpx;
				border-radius: 10rpx;
				border: 1rpx solid #767676;
				font-weight: 500;
				font-size: 24rpx;
				color: #222222;
				margin-left: 20rpx;
				min-width: 140rpx;
				display: flex;
				align-items: center;
				justify-content: center;
			}
			.fukuan{
				background: #FF7C41;
				color: #fff;
				border: none;
			}
			.queren{
				background: #483C38;
				color: #fff;
				border: none;
			}
		}
	}
	.nodata{
		margin: 200rpx auto;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		.kzt_img_zwsj{
			width: 156rpx;
			height: 128rpx;

		}
		text{
			font-weight: 400;
			font-size: 28rpx;
			color: #808080;
			display: block;
			margin-top: 30rpx;
		}
	}
	.shengku{
		font-weight: 500;
		font-size: 28rpx;
		color: #999999;
		display: block;
		margin-top: 8rpx;
	}
	.tablei{
		padding: 10rpx 90rpx 8rpx;
		display: flex;
		flex-direction: row;
		
		.leiitem{
			height: 68rpx;
			background: #F3F3F3;
			border-radius: 34rpx;
			display: flex;
			flex-direction: row;
			width: 100%;
			.tabitem{
				width: 50%;
				height: 100%;
				position: relative;
				display: flex;
				align-items: center;
				justify-content: center;
				font-weight: bold;
				font-size: 32rpx;
				color: #666666;
			}
			.tactive{
				background: #52443B;
				border-radius: 34rpx;
				color: #fff;
			}
		}
	}
	.menitem{
                display: flex;
                flex-direction: row;
                align-items: center;
                background: #FFFFFF;
                border-radius: 24rpx;
                padding: 25rpx;
                margin: 0 30rpx 20rpx;
                .tu{
                    width: 180rpx;
                    height: 180rpx;
                    margin-right: 20rpx;
                    border-radius: 20rpx;
                }
                .menone{
                    display: flex;
                    flex-direction: column;
                    width: 68%;
                    // height: 100%;
                    .menhead{
                        display: flex;
                        flex-direction: row;
                        align-items: center;
                        .name{
                            font-weight: bold;
                            font-size: 32rpx;
                            color: #272727;
                        }
                        .yingye{
                            font-weight: 500;
                            font-size: 26rpx;
                            color: #24B924;
                        }
                        .yingtime{
                            font-weight: 500;
                            font-size: 26rpx;
                            color: #333333;
                            display: inline-block;
                            margin-left: 18rpx;
                        }
                        .icon_dw{
                            width:22rpx;
                            height: 24rpx;
                            margin-right: 8rpx;

                        }
                        .ju{
                            font-weight: 500;
                            font-size: 28rpx;
                            color: #1A1A1A;
                        }
                        .juli{
                            margin-left: 30rpx;
                            font-weight: 500;
                            font-size: 24rpx;
                            color: #999999;
                            display: inline-block;
                            max-width: 70%;
                        }
						.tiview{
							margin-left: auto;
							width: 200rpx;
							height: 68rpx;
							background: #52443B;
							border-radius: 16rpx 16rpx 16rpx 16rpx;
							display: flex;
							align-items: center;
							justify-content: center;
							font-weight: bold;
							font-size: 28rpx;
							color: #FFFFFF;
						}
                    }
                    .mennav{
                        margin-top: 35rpx;
                    }
                }
            }
        // }
</style>
